* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin-bottom: 3rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f9fafb;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4f46e5;
    background: #f0f9ff;
    transform: translateY(-2px);
}

.upload-content h3 {
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
    color: #374151;
}

.upload-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

/* Settings Section */
.settings-section {
    margin-bottom: 2rem;
}

.settings-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

.settings-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.5rem;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6b7280;
}

.format-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #374151;
}

.format-select option:disabled {
    color: #9ca3af;
    background-color: #f3f4f6;
}

.format-info {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
}

.format-note {
    font-size: 0.875rem;
    color: #0369a1;
    line-height: 1.4;
    display: block;
}

.compress-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.compress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.4);
}

.compress-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Section */
.progress-section {
    margin-bottom: 2rem;
}

.progress-card {
    background: #f0f9ff;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 1px solid #bae6fd;
}

.progress-card h3 {
    color: #0369a1;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0f2fe;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    color: #0369a1;
    font-weight: 500;
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
}

/* 结果区域样式 */
.results-section {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.results-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.batch-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.batch-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(79, 70, 229, 0.4);
}

.batch-download-btn:active {
    transform: translateY(0);
}

.batch-download-btn svg {
    transition: transform 0.3s ease;
}

.batch-download-btn:hover svg {
    transform: translateY(2px);
}

.batch-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.batch-download-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.batch-download-btn:disabled svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 结果展示区域 */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.result-card {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    min-height: 60px;
}

.result-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* 文件缩略图 */
.file-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
    margin-right: 12px;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文件信息 */
.file-info {
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-details {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.file-type {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.file-size {
    color: #6b7280;
}

/* 压缩信息 */
.compression-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 12px;
    min-width: 80px;
}

.compression-ratio {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
}

.compressed-size {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* 文件操作 */
.file-actions {
    flex-shrink: 0;
}

.download-btn-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.download-btn-compact:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.download-btn-compact:active {
    transform: translateY(0);
}

.download-btn-compact svg {
    width: 14px;
    height: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .result-card {
        padding: 10px 12px;
        min-height: 56px;
    }
    
    .file-thumbnail {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .file-details {
        font-size: 11px;
    }
    
    .compression-info {
        margin-right: 8px;
        min-width: 70px;
    }
    
    .download-btn-compact {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .download-btn-compact svg {
        width: 12px;
        height: 12px;
    }
}

/* 保留旧的样式类以兼容 */
.result-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.result-header h4 {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.result-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.size-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.original-size {
    color: #ef4444;
    font-weight: 500;
}

.format-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.result-actions {
    flex-shrink: 0;
    margin-left: 1rem;
}

.download-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.download-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.download-btn svg {
    width: 16px;
    height: 16px;
}

/* 移除旧的样式 */
.compression-note {
    display: none;
}

.image-comparison {
    display: none;
}

.image-preview {
    display: none;
}

.image-info {
    display: none;
}

.download-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.download-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

/* Footer */
.footer {
    color: white;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.feature h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main {
        padding: 1.5rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .image-comparison {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}